<?php
$grades = [
    '一号裁判'=>98.2,
    '二号裁判'=>97.5,
    '三号裁判'=>91,
    '四号裁判'=>89,
    '五号裁判'=>99,
    '六号裁判'=>98.5,
    '七号裁判'=>96.6,
    '八号裁判'=>93.4,
];
function outGrade($grades)
{


    asort($grades);
    print_r($grades);
    $b = array_keys($grades);

    echo '打出最高分的裁判为：', $b[0], '打分为：', max($grades), "\n";
    echo '打出最低分的裁判为：', $b[count($b) - 1], '打分为：', min($grades), "\n";
    $average = (array_sum($grades) - max($grades) - min($grades)) / (count($grades) - 2);
    $average_ = number_format($average, 2);
    echo '最后得分为：', $average_;

}
outGrade($grades);
